/**====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*

lcd_dev.h

Copyright (c) 2003 by CHIPNUTS Incorporated. All Rights Reserved.
*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/

/**===========================================================================

 Revisions of key_dev.h
 Version  		Name       	Date			Description
 1.0  		eagle		06/08/2004  	Initial Version  

*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
#ifndef ILI9320_16BIT_DRV_H
#define ILI9320_16BIT_DRV_H

#include "lcd.h" 

#define LCD_BASE_ADDR						(0x06000000)
#define LCD_ILI9320_16BIT_ADDR		(LCD_BASE_ADDR+0x000000)
#define LCD_ILI9320_16BIT_DATA		(LCD_BASE_ADDR+0x000002)


#define IN_UINT8(port) (*((volatile UINT8 *) (port)))
#define IN_UINT16(port) (*((volatile UINT16 *) (port)))

#define OUT_UINT8(port, val) (*((volatile UINT8 *)(port)) = ((UINT8)(val)))
#define OUT_UINT16(port, val) (*((volatile UINT16 *)(port)) = ((UINT16)(val)))

#define LCD_ADDR_WRITE_ILI9320_16BIT( addr)			OUT_UINT16(LCD_ILI9320_16BIT_ADDR,addr)
#define LCD_DATA_WRITE_ILI9320_16BIT( data)			OUT_UINT16(LCD_ILI9320_16BIT_DATA,data)
#define LCD_DATA_READ_ILI9320_16BIT(addr)				IN_UINT16(LCD_ILI9320_16BIT_DATA) 


extern DL_DISP_RET_T dl_lcd_ILI9320_back_light_on(UINT8 cnt);
extern DL_DISP_RET_T dl_lcd_init_ILI9320_16BIT(void);
extern DL_DISP_RET_T dl_lcd_ILI9320_16BIT_set_disp_win(UINT16 angle, UINT16 x_start ,UINT16 y_start ,UINT16 width ,UINT16 height);
extern DL_DISP_RET_T dl_lcd_ILI9320_16BIT_disp_block(UINT16 x_start ,UINT16 y_start ,UINT16 width ,UINT16 height,UINT16 color);
extern DL_DISP_RET_T dl_lcd_ILI9320_16BIT_display_scn(UINT16 x_start ,UINT16 y_start ,UINT16 width ,UINT16 height,UINT8 * p_buf);
extern DL_DISP_RET_T dl_lcd_ILI9320_16BIT_set_scanmode(UINT8 scanmode);
#endif


